package com.mastercard.labs

class Transaction {

    static constraints = {
    }
	
	float amount
	User user
	Card card
	String currency
	String description
	Date txnDate
	Date createDate
	String type // Can be auth / settlement
	Merchant merchant
	
	def afterInsert() {
		def txnCategory = new TransactionCategory()
		txnCategory.transaction = this
		txnCategory.category = this.merchant.categories.get(0)
		txnCategory.save()
	}
}
